package com.jinbai.service;

import com.jinbai.dao.ArticleDao;
import com.jinbai.model.Article;
import com.jinbai.model.BlogContentResult;
import com.jinbai.model.User;

public class BlogContentResultService {
    public BlogContentResult blogContentResult(User user, String aid) {
        ArticleDao articleDao = new ArticleDao();
        BlogContentResult blogContentResult = new BlogContentResult();

        blogContentResult.currentUser = user;
        blogContentResult.articleCount = articleDao.selectArticleCountByUid(user.uid);
        blogContentResult.typeCount = articleDao.selectTypeCountByUid(user.uid);
        blogContentResult.article = articleDao.selectOneArticleByAid(Integer.parseInt(aid));
        return blogContentResult;
    }
}
